import java.util.Scanner;

public class BankDemo08 {
    public static void main(String[] args) {
        /*
            取款机取钱

            1、验证卡号
            2、验证密码
            3、验证余额
         */
        String card = "12345";// 卡号
        String password = "12345";// 密码
        float balance = 1000f;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入卡号");
        String c = scanner.next();
        if (c.equals(card)) {
            for (int i = 0; i <3 ; i++) {

            }
            System.out.println("请输入密码");
            String p = scanner.next();
            if (p.equals(password)) {
                System.out.println("请输入取款金额");
                float b = scanner.nextFloat();
                if (balance >= b) {
                    System.out.println("取款成功余额剩" + (balance - b) + "元");
                } else {
                    System.out.println("余额不够");
                }

            } else {
                System.out.println("密码错误");
            }
        } else {
            System.out.println("卡号不对");
        }

    }
}
